import com.daytask.formbean.DaytaskFinish;
import com.daytask.formbean.DaytaskSet;
import com.daytask.formbean.SonTasktype;
import com.daytask.formbean.TasktypeFrom;
import com.jfinal.config.Constants;
import com.jfinal.config.Handlers;
import com.jfinal.config.Interceptors;
import com.jfinal.config.JFinalConfig;
import com.jfinal.config.Plugins;
import com.jfinal.config.Routes;
import com.jfinal.plugin.activerecord.ActiveRecordPlugin;
import com.jfinal.plugin.c3p0.C3p0Plugin;

public class DemoConfig extends JFinalConfig {

	@Override
	public void configConstant(Constants me) {
		me.setEncoding("utf-8");

	}

	@Override
	public void configRoute(Routes me) {
		me.add(new baseRoute());// 加入我们的路由
	}

	@Override
	public void configPlugin(Plugins me) {

		C3p0Plugin cp = new C3p0Plugin(
				"jdbc:mysql://127.0.0.1/test?characterEncoding=utf8", "root",
				"root");
		cp.setDriverClass("com.mysql.jdbc.Driver");
		me.add(cp);
		ActiveRecordPlugin arp = new ActiveRecordPlugin(cp);
		me.add(arp);
		arp.addMapping("tb_tasktype","id", TasktypeFrom.class);
		arp.addMapping("tb_son_tasktype", "id", SonTasktype.class);
		arp.addMapping("tb_daytask_finish", "id", DaytaskFinish.class);
	}

	@Override
	public void configInterceptor(Interceptors me) {
		// TODO Auto-generated method stub

	}

	@Override
	public void configHandler(Handlers me) {
		// TODO Auto-generated method stub

	}

}
